import http from '../../http'
// 初始页面
const users = async (obj) => {
    let data = await http.get('users', {
        params: obj
    })
    return data
}
// 修改状态
const add = async (obj) => {
    let data = await http.post(`users`, obj)
    return data
}
// 修改状态
const tapstate = async (obj) => {
    let data = await http.put(`users/${obj.id}/state/${obj.mg_state}`)
    return data
}
// 编辑回填
const updata = async (obj) => {
    let data = await http.get(`users/${obj.id}`)
    return data
}
// 提交编辑
const updatauser = async (obj) => {
    let data = await http.put(`users/${obj.id}`, obj)
    return data
}
// 删除
const deleteda = async (obj) => {
    let data = await http.delete(`users/${obj.id}`)
    return data
}
// 分配角色
const fenpei = async (obj) => {
    let data = await http.put(`users/${obj.rid}/role`, {rid:obj.id})
    return data
}
export { users, add, tapstate, updata, updatauser, deleteda, fenpei }